﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace UtilsORM.MySqlData;

/// <summary>
/// 设备变量，根据传感器上传的值变量，把变量名字填入这个表里面
/// </summary>
[Index("v_guid", Name = "idxdclguid")]
[Index("v_key", Name = "idxkey")]
[MySqlCharSet("utf8mb3")]
[MySqlCollation("utf8mb3_general_ci")]
public partial class iot_device_model_variable
{
    [Key]
    public long v_id { get; set; }

    public string v_guid { get; set; }

    /// <summary>
    /// 值key
    /// </summary>
    public string v_key { get; set; }

    [Column(TypeName = "datetime")]
    public DateTime v_add_time { get; set; }

    /// <summary>
    /// 说明
    /// </summary>
    [StringLength(255)]
    public string v_remark { get; set; }

    /// <summary>
    /// number/string/bool值类型
    /// </summary>
    [StringLength(255)]
    public string v_value_type { get; set; }

    [StringLength(255)]
    public string v_name { get; set; }

    /// <summary>
    /// 0可上传数据值，1可执指令
    /// </summary>
    public int? v_export { get; set; }

    /// <summary>
    /// 数值单位
    /// </summary>
    [StringLength(255)]
    public string v_unit { get; set; }

    /// <summary>
    /// 0有效，1无效
    /// </summary>
    public int? v_status { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    public int? v_order { get; set; }
}
